package com.ccit.paas.controller;

import com.ccit.paas.domain.StudentPO;
import com.ccit.paas.service.IStudentService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


/**
 * 微服务之间相互调用的接口，引入worlflow-demo-api.jar包通过feign方式调用
 *
 * @author: chinacoalit.com
 * @date 2024/1/9 15:51
 * @version: v1.0 初始化
 */
@RestController
@RequestMapping("/api")
public class StudentFeignController {

    @Autowired
    private IStudentService studentService;

    /**
     * hello
     * @param
     * @return java.lang.String
     * @exception
     * @author chinacoalit.com
     * @date 2024/1/9 15:52
     */
    @GetMapping("/hello")
    public String sayHello(){
        return "你好：hello";
    }

    /**
     * 获取学生信息列表
     * @param
     * @return java.util.List<com.ccit.paas.domain.StudentDO>
     * @exception
     * @author chinacoalit.com
     * @date 2024/1/9 15:52
     */
    @GetMapping("/list")
    public List<StudentPO> getStudentList(){
        return studentService.list();
    }
}
